﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public abstract class IStage
{
    /// <summary>
    /// 初始化
    /// </summary>
    public virtual void Start() { }

    /// <summary>
    /// 销毁
    /// </summary>
    public virtual void Destroy() { }

    /// <summary>
    /// 更新
    /// </summary>
    /// <param name="deltaTime"></param>
    public abstract void Update(float deltaTime);

    /// <summary>
    /// 添加IWorldObject
    /// </summary>
    /// <param name="worldObj"></param>
    public abstract void AddWorldObj(IWorldObject worldObj);

    /// <summary>
    /// 移除IWorldObject
    /// </summary>
    /// <param name="id"></param>
    public abstract void RemoveWorldObj(int id);

    /// <summary>
    /// 获取IWorldObject
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public abstract IWorldObject GetWorldObj(int id);

    /// <summary>
    /// 判断存在IWorldObject
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public abstract bool HasWorldObj(int id);

    /// <summary>
    /// 获取WorldObject列表
    /// </summary>
    /// <returns></returns>
    public virtual List<IWorldObject> GetWorldObjs()
    {
        return new List<IWorldObject>();
    }

    /// <summary>
    /// 获取对象列表
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <returns></returns>
    public abstract List<T> GetObjs<T>();

    /// <summary>
    /// 获取
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="id"></param>
    /// <returns></returns>
    public abstract T GetObj<T>(int id);


}
